package toolkit.tianshi.common.model;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

/**
 * @author zhangLin
 */
public class Pager<T> implements Serializable {

    private static final long serialVersionUID = 8496769101348772278L;
    private Long total;
    private List<T> data;

    public Pager() {
    }

    public Pager(Long total, List<T> data) {
        this.data = data;
        this.total = total;
    }

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    public static <T> Pager<T> empty(Class<T> clazz) {
        List<T> emptyList = Collections.emptyList();
        return new Pager<T>(Long.valueOf(0L), emptyList);
    }
}
